﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:n="http://nRoute/schemas/2010/xaml"
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
    xmlns:local="clr-namespace:Officer2013.Infrastructure.Controls;assembly=Officer2013.Infrastructure">
	
	<!-- Template ITEM TEMPLATE, NOTE_ the use of navigation behaviour and the transparent background -->    
	<DataTemplate x:Key="DocumentTemplateTemplate">
        
		<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="105" Width="84" 
			Cursor="Hand" Background="Transparent">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="MouseLeftButtonUp">
                    <n:NavigateAction Url="{Binding Path=PanelUrl}" HandlerName="SidePanelContainer" />
                </i:EventTrigger>
            </i:Interaction.Triggers>

            <Image Source="{Binding Path=IconPath}" VerticalAlignment="Top" HorizontalAlignment="Center"
                    Height="75" Width="70" Stretch="UniformToFill" />
            <TextBlock Margin="2,72,2,2" VerticalAlignment="Top" FontFamily="Segoe UI Symbol"
              TextAlignment="Center" FontSize="11.5" Text="{Binding Path=Title}" TextWrapping="Wrap"/>
		</Grid>
        
	</DataTemplate>
   
	<!-- LIST BOX STYLE -->
	<Style x:Key="DocumentTemplatesListBoxStyle" TargetType="ListBox">
		<Setter Property="Padding" Value="0"/>
		<Setter Property="Background" Value="#FFFFFFFF"/>
		<Setter Property="Foreground" Value="#FF000000"/>
		<Setter Property="HorizontalContentAlignment" Value="Left"/>
		<Setter Property="VerticalContentAlignment" Value="Top"/>
		<Setter Property="IsTabStop" Value="False"/>
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="TabNavigation" Value="Once"/>
        <Setter Property="BorderBrush"  Value="{x:Null}" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="ListBox">
                    <ScrollViewer BorderBrush="#FFEDEEF0" Padding="0" VerticalScrollBarVisibility="Auto">
					    <ItemsPresenter/>
                    </ScrollViewer>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<!-- LIST BOX ITEMS CONTAINER -->
	<ItemsPanelTemplate x:Key="DocumentTemplatesItemsPanelTemplate">
        <local:WrapPanel />
	</ItemsPanelTemplate>
    
    <!-- LIST BOX ITEMS CONTAINER -->
	<Style x:Key="DocumentTemplateItemContainerStyle" TargetType="ListBoxItem">
		<Setter Property="Padding" Value="3"/>
        <Setter Property="Margin" Value="4"/>
		<Setter Property="HorizontalContentAlignment" Value="Left"/>
		<Setter Property="VerticalContentAlignment" Value="Top"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="TabNavigation" Value="Local"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="ListBoxItem">
					<Grid Background="{TemplateBinding Background}">
						<vsm:VisualStateManager.VisualStateGroups>
							<vsm:VisualStateGroup x:Name="CommonStates">
								<vsm:VisualState x:Name="Normal"/>
								<vsm:VisualState x:Name="MouseOver">
									<Storyboard>
										<DoubleAnimationUsingKeyFrames Storyboard.TargetName="fillColor" 
											Storyboard.TargetProperty="Opacity">
											<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
										</DoubleAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" 
											Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(UIElement.Visibility)">
											<DiscreteObjectKeyFrame KeyTime="00:00:00">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</vsm:VisualState>
								<vsm:VisualState x:Name="Disabled">
									<Storyboard>
										<DoubleAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" 
											Storyboard.TargetProperty="Opacity">
											<SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</vsm:VisualState>
							</vsm:VisualStateGroup>
							<vsm:VisualStateGroup x:Name="SelectionStates">
								<vsm:VisualState x:Name="Unselected"/>
								<vsm:VisualState x:Name="Selected">
									<Storyboard>
										<DoubleAnimationUsingKeyFrames Storyboard.TargetName="fillColor2" 
											Storyboard.TargetProperty="Opacity">
											<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</vsm:VisualState>
							</vsm:VisualStateGroup>
							<vsm:VisualStateGroup x:Name="FocusStates">
								<vsm:VisualState x:Name="Focused"/>
								<vsm:VisualState x:Name="Unfocused"/>
							</vsm:VisualStateGroup>
						</vsm:VisualStateManager.VisualStateGroups>
                        
						<Rectangle x:Name="fillColor" RadiusX="5" RadiusY="5" IsHitTestVisible="False" 
                                   Opacity="0" StrokeThickness="1" Stroke="#FFC7A948">
							<Rectangle.Fill>
								<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FFFFDF76" Offset="0.057"/>
                                    <GradientStop Color="#FFFFF3A5" Offset="0.951"/>
                                    <GradientStop Color="#FFFED86B" Offset="0.077"/>
                                </LinearGradientBrush>
							</Rectangle.Fill>
						</Rectangle>
						<Rectangle x:Name="fillColor2" RadiusX="5" RadiusY="5" IsHitTestVisible="False" 
                                   Opacity="0" Stroke="#FFC97026" StrokeThickness="1">
							<Rectangle.Fill>
								<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
									<GradientStop Color="#FFF5B06F"/>
									<GradientStop Color="#FFF8D168" Offset="1"/>
									<GradientStop Color="#FFE19154" Offset="0.341"/>
									<GradientStop Color="#FFE2782A" Offset="0.374"/>
									<GradientStop Color="#FFF1B454" Offset="0.943"/>
								</LinearGradientBrush>
							</Rectangle.Fill>
						</Rectangle>
                        
						<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
							Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" 
							ContentTemplate="{TemplateBinding ContentTemplate}"/>
                        
						<Rectangle x:Name="FocusVisualElement" Stroke="#FFBFA141" StrokeThickness="1" RadiusX="5" RadiusY="1" 
							Visibility="Collapsed" Opacity="0"/>
                        
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
</ResourceDictionary>